<?php

namespace App\Models\Shop;

use App\User;
use Illuminate\Database\Eloquent\Model;

class Account extends Model
{
   protected $fillable = ['account_id', 'money', 'integral'];

   //账户属于用户
   public function user()
   {
      return $this->belongsTo(User::class, 'user_id');
   }

   //账户和优惠券多对多
   public function tickets()
   {
      return $this->belongsToMany(Ticket::class, 'account_tickets');
   }

}
